package Book;


public class BookList {
    private Book[] books = new Book[10];
    private int bookNumber;

    public BookList(){
        books[0] = new Book("三国演义","罗贯中",90,"小说");
        books[1] = new Book("西游记","吴承恩",90,"小说");
        books[2] = new Book("红楼梦","曹雪芹",90,"小说");
        this.bookNumber = 3;
    }

    public int getBookNumber() {
        return bookNumber;
    }

    public void setBookNumber(int bookNumber) {
        this.bookNumber = bookNumber;
    }

    //获得书的信息
    public Book getBook(int post){
        return books[post];
    }

    //放入书
    public void putBook(Book book,int post){
        books[post] = book;
    }

    //删除书
    public void delBook(int post){
        for (int i = post; i < bookNumber-1; i++) {
            books[i] = books[i+1];
        }
    }

}
